package com.cande.loki.exercise.javabasic;

import io.netty.util.internal.ThrowableUtil;
import org.springframework.util.StringUtils;

import java.io.File;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

class Data{
    private int a=0;
    public int b=0;
    public void add(int aa,int bb){
        a=aa+1;
        b=bb+1;
    }

    public int getA() {
        return a;
    }
}

public class TestJava {



    private static int add(int a){
        return a++;
    }


    public static String getOrgDataDistinct(String datas){
        Set<String> orgSet = new HashSet<>();
        if(datas.length() > 0){
            String[] dataArray = datas.split(",");
            for(String data : dataArray){
                String orgID = data.split("-")[0];
                orgSet.add(orgID);
            }
        }
        return String.join(",", orgSet);
    }
    public static void filter( Integer li){

        String kkl = "11444";
        kkl = kkl.substring(1);

//        li  = li.stream().filter(a->a.getName().equals("aa")).collect(Collectors.toList());
        li = 2;
        System.out.println(li); //aa
    }
    public static List<User>  hhh (List<User> l ,int a, String ssss){
        l = l.stream().filter(x->x.getAge()==1).collect(Collectors.toList());
        a=2;
        ssss = "2";
        return l;
    }
    public static void main(String[] args) throws ParseException {

        File file = new File(".");
        File file1 = new File("/");


        String a33 ="";
        String a331 =null;
        String resu33 = a33 +a331;


        User uuu = new User();
        uuu.setAge(1); User uuu1 = new User();
        uuu1.setAge(2);
        List<User> LL = new ArrayList<>();
        LL.add(uuu);
        LL.add(uuu1);
        int inttt = 1;
        String ssss = "1";
        List<User> userList11 = hhh(LL,inttt,ssss);


        Data cac = new Data();
        cac.add(2,3);
        System.out.println(cac.b);
        System.out.println(cac.getA());
        StringBuilder bu = new StringBuilder();
        bu.append("2");
        int num = 0;int num1=0;
        add(num);
        System.out.println(num++);
        System.out.println(++num1);
        System.out.println(add(num));


        Integer saa =1;
        filter(saa);





BigDecimal BG = new BigDecimal(3.33333333333333333333333333333333);
        BigDecimal BG1 = new BigDecimal(3);
        BigDecimal BG2 = BG.multiply(BG1);
        String pld = "136845292-7,136845286-7,136845288-7,136845290-7,136842704-7,136845090-7,136921408-7,136845284-7,136545670-0,136847536-8,136943842-8,136943846-8,136679250-1,136679300-1,136545672-1,136679284-1,136679316-1,136714862-1,136679268-1,136943870-8,136545668-2,136943874-8,136943878-8,136845652-0,136841794-0,136847352-0,136837578-4,136943882-8,136845452-1,136943868-8,136901632-0,136943884-8,136921392-1";

        String pldd = getOrgDataDistinct(pld);

            Set<String> orgSet = new HashSet<>();

                    orgSet.add("orgID");
                    orgSet.add("1123");

        String pl =   String.join(",", orgSet);

        System.out.println(0.0/-23);


        System.out.println((1==1 &&1==2 )? true : false);

        Long a = 128L;
        Long b = 128L;
        System.out.println(a == b);
        System.out.println(a.equals(b));
        System.out.println(a == 128);
        System.out.println(a.equals(128));
        if(true) aa: {
            if (true){
                break aa;
            }
            System.out.println("klkl");
        }

        Boolean TTT=false;
        testa(TTT);

        List<User>  detailList  = new ArrayList<>();
        //一张单子一张单子判断是否要验货
        String billIDs = detailList.stream().map(e->e.getMoney().toString()).distinct().collect(Collectors.joining(","));

        Arrays.stream(billIDs.split(",")).forEach(e->{
            System.out.println(1111);
        });

        System.out.println("aa"=="aa");
//        Integer  KA= null;
//        if (2==KA.intValue()){
//
//        }
        List<User> userList = new ArrayList<>();
        User c= new User();
        System.out.println(c.getDecimal()+"");
        User d= new User();
        d.setName("1");
        userList.add(c);
        userList.add(d);
        userList.sort(Comparator.comparing(User::getMoney,Comparator.nullsFirst(Integer::compareTo)).thenComparing(User::getName,Comparator.nullsFirst(String::compareTo)));
        List<User> userList2 = Arrays.asList(new User[userList.size()]);
        Collections.copy(userList2, userList);
        System.out.println(userList2==userList);

//        userList2.remove(1);



        String AA = userList.stream().filter(e-> !StringUtils.isEmpty(e.getName())).map(e -> "'"+e.getName()+"'").collect(Collectors.toSet()).stream().collect(Collectors.joining(","));
        System.out.println(AA);


        String adsa = "[\"淡奶油(14寸)个\",\"草莓马卡龙(10寸)个\",\"鲜果雪舞(16寸)个\",\"青葱岁月(14寸)个\",\"花团锦簇(16寸)个\",\"卡通布朗熊(6寸)个\",\"小恶魔(12寸)个\",\"胡萝卜棒袋\",\"尊爵(6寸)个\",\"熊孩子(12寸)个\",\"福禄寿喜(8寸)个\",\"一抹嫣红(8寸)个\",\"双莓诱惑(6寸)个\",\"招牌奶茶杯\",\"莓丽炫彩(18寸)个\",\"思香绿豆冰糕随手盒盒\",\"咸鸭蛋(礼盒)盒\",\"全麦吐司袋\",\"轻乳酪蛋糕个\",\"乳酪面包个\",\"古早火腿色拉包个\",\"2.5米定制蛋糕个\",\"四格水果(10寸)个\",\"小莓满(12寸)个\",\"熊熊物语(8寸)个\",\"水果双拼(14寸)个\",\"德式猪排面包个\",\"水果双拼(8寸)个\",\"巧虎纳福(6寸)个\",\"定制款蛋糕(14寸)个\",\"浮云卷蛋糕盒\",\"6米定制蛋糕个\",\"美好生活(18寸)个\",\"草莓淡奶(14寸)个\",\"喜上眉梢(6寸)个\",\"芒芒酪酪(18寸)个\",\"莓丽空间(12寸)个\",\"粽情礼盒盒\",\"绿豆糕(10粒)盒\",\"典藏青涩(10寸)个\",\"蛋黄猪肉粽粒\",\"黑森林(8寸)个\",\"鲜奶油(10寸)个\",\"淡奶油(6寸)个\",\"红秀淡奶(14寸)个\",\"黑森林切块(三角形)个\",\"美好生活(6寸)个\",\"一抹嫣红(16寸)个\",\"芒果恰恰(6寸)个\",\"萌萌牛(8寸)个\",\"熊熊物语(12寸)个\",\"森林小鹿(14寸)个\",\"花语(14寸)个\",\"松松酥条盒\",\"淡奶切块个\",\"黄金甲(8寸)个\",\"生日帽个\",\"小熊(10寸)个\",\"青葱岁月(6寸)个\",\"草莓淡奶(6寸)个\",\"桃思慕雪个\",\"盘子个\",\"鲜果脆脆(16寸)个\",\"5.5米定制蛋糕个\",\"夏日柚闲(18寸)个\",\"芒芒酪酪(16寸)个\",\"果香贺高堂(8寸)个\",\"双莓诱惑(18寸)个\",\"花样甜心(14寸)个\",\"淡奶油(8寸)个\",\"秀逗城堡(10寸)个\",\"草莓裸蛋糕(10寸)个\",\"榛果泡泡(14寸)个\",\"奥利奥鲜果(16寸)个\",\"诚意芒芒(14寸)个\",\"熊熊物语(14寸)个\",\"小猪佩奇(8寸)个\",\"刀叉盘打包袋个\",\"踏雪觅莓(8寸)个\",\"草莓淡奶(8寸)个\",\"典藏青涩(12寸)个\",\"鲜果脆脆(14寸)个\",\"红秀淡奶(8寸)个\",\"草莓公主(8寸)个\",\"2米定制生日蛋糕个\",\"巧克力百汇(6寸)个\",\"一颗柠檬茶杯\",\"斯利美白吐司袋\",\"季朵餐包袋\",\"草莓公主(14寸)个\",\"草莓马卡龙(12寸)个\",\"青涩年华(4寸)个\",\"奥利奥朵朵个\",\"蜘蛛侠(14寸)个\",\"草莓饼礼盒盒\",\"桃胶生椰乳杯\",\"杨梅柚柑个\",\"传统绿豆糕(黑芝麻)盒\",\"双莓诱惑(8寸)个\",\"芒果恰恰(10寸)个\",\"提拉米苏盒子盒\",\"美好生活(8寸)个\",\"爱你哦(12寸)个\",\"水果百汇(8寸)个\",\"红秀淡奶(16寸)个\",\"雪景(8寸)个\",\"四格水果(12寸)个\",\"定制款蛋糕(8寸)个\",\"新焗烤三明治个\",\"小恶魔(8寸)个\",\"小猪佩奇(10寸)个\",\"粽意礼盒盒\",\"个性化(16寸)个\",\"秀逗城堡(6寸)个\",\"瓶装牛奶瓶\",\"1米定制蛋糕个\",\"莓丽炫彩(6寸)个\",\"花团锦簇(14寸)个\",\"卡通布朗熊(10寸)个\",\"香缇芒果个\",\"罐尝四季-草莓果酱瓶\",\"熊孩子(6寸)个\",\"榴莲酥盒\",\"莓丽空间(14寸)个\",\"草莓公主(12寸)个\",\"双莓诱惑(14寸)个\",\"鲜奶油(6寸)个\",\"补卡次\",\"2.8米定制蛋糕个\",\"典藏青涩(8寸)个\",\"芝士麻薯份\",\"草莓淡奶(16寸)个\",\"爱你哦(8寸)个\",\"一抹嫣红(18寸)个\",\"熊熊物语(10寸)个\",\"鲜果脆脆(8寸)个\",\"金牛角袋\",\"芒果恰恰(12寸)个\",\"草莓格莱美杯\",\"纯牛奶(兵牧)瓶\",\"NFC橙汁瓶\",\"香缇奥利奥个\",\"罐尝四季-蓝莓果酱瓶\",\"若雪原味酸牛奶瓶\",\"芒果格莱美杯\",\"青葱岁月(8寸)个\",\"夏日柚闲(6寸)个\",\"鲜果脆脆(18寸)个\",\"鸡蛋饼袋\",\"巧克力桃仁酥罐\",\"珍情绿豆冰糕礼盒盒\",\"奥利奥鲜果(12寸)个\",\"四格水果(18寸)个\",\"鲜果雪舞(14寸)个\",\"淡奶油(12寸)个\",\"巧虎纳福(8寸)个\",\"卡通布朗熊(8寸)个\",\"巧克力百汇(10寸)个\",\"焦糖板栗格莱美杯\",\"美好生活(10寸)个\",\"鲜奶油(18寸)个\",\"小恶魔(14寸)个\",\"传统绿豆糕(细沙)盒\",\"糕粽礼盒盒\",\"福禄寿喜(6寸)个\",\"花样甜心(12寸)个\",\"熊孩子(10寸)个\",\"外送费次\",\"莓丽炫彩(16寸)个\",\"秀逗城堡(12寸)个\",\"摆台(999款)个\",\"个性化(8寸)个\",\"1.5米定制蛋糕个\",\"典藏青涩(18寸)个\",\"诚意芒芒(16寸)个\",\"踏雪觅莓(6寸)个\",\"蜘蛛侠(6寸)个\",\"北海道戚风蛋糕盒\",\"原味千层个\",\"芒芒酪酪(6寸)个\",\"小莓满(14寸)个\",\"夏日柚闲(10寸)个\",\"芒果千层个\",\"巧克力百汇(8寸)个\",\"临时菜份\",\"水果双拼(12寸)个\",\"芋泥奶贝蛋糕盒\",\"定制款蛋糕(12寸)个\",\"馥刻咸蛋糕盒\",\"榛果泡泡(12寸)个\",\"喜上眉梢(8寸)个\",\"迷你手撕包个\",\"鲜果雪舞(12寸)个\",\"草莓马卡龙(14寸)个\",\"淡奶油(10寸)个\",\"鲜奶油(16寸)个\",\"秀逗城堡(8寸)个\",\"小莓满(16寸)个\",\"花纹蛋糕个\",\"美好生活(12寸)个\",\"原味松松面包个\",\"冰淇淋(8寸)个\",\"草莓马卡龙(8寸)个\",\"火山石烤肠包个\",\"花语(6寸)个\",\"佩奇之家(10寸)个\",\"美式咖啡杯\",\"1.8米定制生日蛋糕个\",\"寿比南山（8寸）个\",\"花语(12寸)个\",\"椰香酸奶个\",\"爱你哦(14寸)个\",\"紫薯小丸子罐\",\"尊爵(8寸)个\",\"水果百汇(6寸)个\",\"红秀淡奶(18寸)个\",\"小莓满(8寸)个\",\"蜘蛛侠(8寸)个\",\"草莓甜心可颂个\",\"三明治个\",\"小熊(12寸)个\",\"定制款蛋糕(6寸)个\",\"个性化(18寸)个\",\"水果双拼(10寸)个\",\"花团锦簇(12寸)个\",\"快乐星球A款(4寸)个\",\"玫瑰蛋黄酥个\",\"定制款蛋糕(10寸)个\",\"卡通布朗熊(12寸)个\",\"踏雪觅莓(10寸)个\",\"芒芒酪酪(14寸)个\",\"莓丽空间(16寸)个\",\"鲜奶油(8寸)个\",\"青葱岁月(16寸)个\",\"双莓诱惑(16寸)个\",\"可可坚果脆罐\",\"庆典蛋糕(40X60款)个\",\"千层蛋糕(六寸)个\",\"海藻糖绿豆糕(4粒装)盒\",\"草莓淡奶(18寸)个\",\"草莓裸蛋糕(8寸)个\",\"爱你哦(6寸)个\",\"福禄寿喜(10寸)个\",\"索菲亚罐\",\"踏雪寻莓盒\",\"芒果恰恰(8寸)个\",\"奥利奥鲜果(14寸)个\",\"鲜果脆脆(6寸)个\",\"水果百汇(10寸)个\",\"新橙汁蛋糕个\",\"2.2米定制生日蛋糕个\",\"喜上眉梢(10寸)个\",\"1.2米定制蛋糕个\",\"快乐星球B款(4寸)个\",\"枣泥核桃蛋糕盒\",\"现烤蛋挞(4个装)盒\",\"雪景(14寸)个\",\"夏日柚闲(14寸)个\",\"小熊(8寸)个\",\"黄油曲奇盒\",\"一抹嫣红(10寸)个\",\"草莓裸蛋糕(6寸)个\",\"诚意芒芒(18寸)个\",\"花样甜心(10寸)个\",\"布朗熊个\",\"芒芒酪酪(12寸)个\",\"诚意芒芒(6寸)个\",\"彩虹城堡(10寸)个\",\"森林小鹿(6寸)个\",\"秀逗城堡(14寸)个\",\"奶昔甜甜圈个\",\"荔枝冰摇茶个\",\"豆腐芝士面包个\",\"个性化(6寸)个\",\"鲜果脆脆(10寸)个\",\"手提袋(大号)个\",\"香缇焦糖女王卷盒\",\"芒芒酪酪(8寸)个\",\"马卡龙礼盒(5粒装)盒\",\"蜂蜜蛋糕袋\",\"抹茶白玉卷盒\",\"鲜果雪舞(8寸)个\",\"典藏青涩(16寸)个\",\"NFC芒果混合汁瓶\",\"榛果泡泡(10寸)个\",\"熊孩子(8寸)个\",\"豆沙椰丝包个\",\"奥利奥鲜果(8寸)个\",\"焦糖伯爵(8寸)个\",\"草莓马卡龙(16寸)个\",\"草莓公主(10寸)个\",\"蜘蛛侠(10寸)个\",\"双莓诱惑(12寸)个\",\"典藏青涩(6寸)个\",\"芒果恰恰(14寸)个\",\"迷你草莓(4寸)个\",\"金典鲜花饼个\",\"皇后吐司袋\",\"韩式香蒜面包个\",\"花团锦簇(6寸)个\",\"新希望纯牛奶瓶\",\"红丝绒慕斯个\",\"夏日柚闲(8寸)个\",\"小热狗(4个装)盒\",\"原味蛋卷(南京款)盒\",\"个性化(12寸)个\",\"小猪佩奇(14寸)个\",\"四格水果(16寸)个\",\"花团锦簇(10寸)个\",\"奥利奥鲜果(10寸)个\",\"卡通布朗熊(14寸)个\",\"香缇草莓个\",\"奥利奥鲜果(6寸)个\",\"寿比南山（12寸）个\",\"枫糖布里欧修个\",\"松松小贝(可可)盒\",\"青葱岁月(18寸)个\",\"草莓朵朵个\",\"杨汁甘露瓶\",\"鲜榨橙梨汁杯\",\"芒果恰恰(16寸)个\",\"香浓北海道吐司个\",\"招牌咖啡杯\",\"淡奶油(18寸)个\",\"莓丽空间(18寸)个\",\"莓丽炫彩(14寸)个\",\"草莓酥饼个\",\"迷你芒果(4寸)个\",\"蛋黄芝士罐\",\"定制款蛋糕(18寸)个\",\"水果双拼(18寸)个\",\"咸鸭蛋粒\",\"椰蓉酥饼(礼盒)盒\",\"NFC番石榴混合汁瓶\",\"个性化(10寸)个\",\"丹麦奶酥红豆个\",\"雪景(12寸)个\",\"鲜果雪舞(10寸)个\",\"小莓满(18寸)个\",\"夏日柚闲(12寸)个\",\"美好生活(14寸)个\",\"鲜奶油(14寸)个\",\"秀逗城堡(16寸)个\",\"草莓马卡龙(6寸)个\",\"一抹嫣红(12寸)个\",\"红秀淡奶(10寸)个\",\"安格拉斯(8寸)个\",\"花语(8寸)个\",\"四格水果(8寸)个\",\"草莓淡奶(10寸)个\",\"手撕包个\",\"花语(10寸)个\",\"3.5米定制蛋糕个\",\"桂圆红枣茶杯\",\"小莓满(6寸)个\",\"法式奶香片份\",\"小熊(14寸)个\",\"蟠桃颂(8寸)个\",\"榛果泡泡(8寸)个\",\"香橙虎皮个\",\"莓丽空间(6寸)个\",\"美好生活(16寸)个\",\"福袋吉祥(8寸)个\",\"蜘蛛侠(12寸)个\",\"迷你小汉堡个\",\"鲜奶油(12寸)个\",\"满福绿豆冰糕礼盒盒\",\"莓丽炫彩(10寸)个\",\"草莓马卡龙(18寸)个\",\"鲜蔬三明治个\",\"四格水果(6寸)个\",\"花样甜心(18寸)个\",\"淡奶油(4寸)个\",\"乳酪球盒\",\"夏日茫茫(4寸)个\",\"诚意芒芒(10寸)个\",\"榴莲饼个\",\"香糯蜜枣粽粒\",\"手提袋(小号)个\",\"罐尝四季-蔓越莓果酱瓶\",\"巧克力曲奇盒\",\"森林小鹿(12寸)个\",\"云朵柚子条袋\",\"花团锦簇(8寸)个\",\"雪景(6寸)个\",\"海苔蛋卷(盒)盒\",\"个性化(14寸)个\",\"巧克力千层个\",\"原味桃酥礼盒盒\",\"提拉米苏(8寸)个\",\"莓丽炫彩(8寸)个\",\"花语(16寸)个\",\"榛果泡泡(6寸)个\",\"榛果泡泡(18寸)个\",\"莓丽空间(8寸)个\",\"萌萌牛(6寸)个\",\"青葱岁月(12寸)个\",\"草莓公主(18寸)个\",\"3米定制蛋糕个\",\"花团锦簇(18寸)个\",\"夏日柚闲(16寸)个\",\"梦幻彩虹(10寸)个\",\"鲜果雪舞(6寸)个\",\"花样甜心(6寸)个\",\"松松卷面包个\",\"流心泡芙(原味)盒\",\"诚意芒芒(8寸)个\",\"小熊(6寸)个\",\"芒芒酪酪(10寸)个\",\"森林小鹿(8寸)个\",\"奥利奥鲜果(18寸)个\",\"小猪佩奇(6寸)个\",\"桃桃白玉卷盒\",\"4米定制蛋糕个\",\"葡萄摇摇乐瓶\",\"提子吐司袋\",\"熊熊物语(6寸)个\",\"红秀淡奶(6寸)个\",\"邻家小莓(4寸)个\",\"草莓公主(6寸)个\",\"传统绿豆糕(原味)盒\",\"松松小贝(4粒装)盒\",\"鸡肉堡个\",\"桃仁瓦片罐\",\"草莓淡奶(12寸)个\",\"胡罗卜吐司袋\",\"纯牛奶瓶\",\"花样甜心(8寸)个\",\"莓丽空间(10寸)个\",\"雪景(10寸)个\",\"草莓公主(16寸)个\",\"牛乳白玉卷盒\",\"青葱岁月(10寸)个\",\"双莓诱惑(10寸)个\",\"炭烧三明治个\",\"红秀淡奶(12寸)个\",\"芝士棒罐\",\"蜂巢蛋糕(盒)盒\",\"5米定制蛋糕个\",\"芋泥虎皮卷盒\",\"一抹嫣红(14寸)个\",\"丹麦奶酥菠萝包个\",\"秀逗城堡(18寸)个\",\"马卡龙（6粒装）盒\",\"草莓奶昔面包个\",\"罐尝四季-百香果果酱瓶\",\"4.5米定制蛋糕个\",\"熊孩子(14寸)个\",\"虎年款生日蛋糕(8寸)个\",\"小恶魔(6寸)个\",\"小猪佩奇(12寸)个\",\"生椰拿铁杯\",\"若雪黄桃味酸牛奶瓶\",\"四格水果(14寸)个\",\"小黄人(10寸)个\",\"青柠摇摇乐瓶\",\"香肠起士个\",\"尊爵(10寸)个\",\"淡奶油(16寸)个\",\"白川蛋糕盒\",\"抹茶红豆软欧个\",\"板栗鲜肉粽粒\",\"小恶魔(10寸)个\",\"莓丽炫彩(12寸)个\",\"花样甜心(16寸)个\",\"草莓麻薯面包个\",\"芒果恰恰(18寸)个\",\"爱你哦(10寸)个\",\"卡斯特拉蛋糕袋\",\"糯米滑奶茶杯\",\"一抹嫣红(6寸)个\",\"诚意芒芒(12寸)个\",\"鲜果脆脆(12寸)个\",\"森林小鹿(10寸)个\",\"皮卡丘个\",\"水果双拼(16寸)个\",\"蛋糕边袋\",\"小莓满(10寸)个\",\"典藏青涩(14寸)个\",\"粽香礼盒盒\",\"水果双拼(6寸)个\",\"花语(18寸)个\",\"葡式蛋挞个\",\"寿比南山（10寸）个\",\"定制款蛋糕(16寸)个\",\"鲜果雪舞(18寸)个\",\"榛果泡泡(16寸)个\"]";

        String []kk = adsa.split(",");


        //Arrays.asList()
        String [] arrstr = new String[]{"a","b"};

//        Arrays.asList(arrstr).add("c");  //这里会报错
        Arrays.asList(arrstr).forEach(e->{
            System.out.println(e);
                }
        );


        String str11 = new String("aa");
        str11.intern();
        String str21 = "aa";
        System.out.println(str11.intern() == str21);
        System.out.println(str11 == str21);
        //intern
        //String.intern()是一个Native方法,它的作用是:如果字符常量池中已经包含一个等于此String对象的字符串,则返回常量池中字符串的引用,否则,将新的字符串放入常量池,并返回新字符串的引用’
        String str1 = new StringBuilder("计算机").append("软件").toString();

        String str2 = new StringBuilder("ja").append("va").toString();

        String str3 = "java";
        String str4 = new String("java");

        System.out.println(str1.intern() == str1);//因为之前没有所以创建的引用和intern()返回的引用相同

        System.out.println(str2.intern() == str2);//"java在StringBuilder()之前已经出现过",所以intern()返回的引用与新创建的引用不是同一个

        System.out.println(str3 == str4);

        //异常
        try {
            throw new Exception();
            } catch(Exception e) {
            System.out.println(ThrowableUtil.stackTraceToString(e));

            }


        Set<Long> goodsIDSet = new HashSet<>();

        String goodsIDs="1,2,,,,";
        String goodsIDs1="1,2,,3,,";

        String[] split1 = new String[]{};
        String[] split = goodsIDs.split(",");
        String[] split2 = goodsIDs1.split(",");
        for (String s : split) {
            goodsIDSet.add(Long.valueOf(s));
        }

        //值传递 引用传递
        String name = "Scott";
        int age = 5;
        User user = new User();
        user.setName(name);
        user.setAge(age);
        user.setUserList(user);
        System.out.println("before change user = " + user);

        change(user, name, age);
        System.out.println("name = " + name);
        System.out.println("age = " + age);
        System.out.println("after change user = " + user);

Long aaa = getFrontMonthDayBynun(202204l,2);
        System.out.println(aaa);
        //获取时间


        //set 判断多个 boolean的最终值
        Set<Boolean> set =new HashSet<>();
        for (int i =1;i<10;i++){
            set.add(true);set.add(false);
        }
        System.out.println(set.size());
    }


    private static void testa(Boolean TTT){
        TTT =true;
    }

    public static Long getFrontMonthDayBynun(Long voucherDate,int num) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(sdf.parse(voucherDate.toString()));
        calendar.add(Calendar.MONTH, num);
        Long hopeCheckDate = Long.valueOf(sdf.format(calendar.getTime()));
        return hopeCheckDate;
    }
    public static void change(User user, String name, int age) {
        name = "Tom"; //相当于把user的引用地址给修改了，java本质还是值传递
        age = 20;
        user.setName(name);
        user.setAge(age);
        User UU = user.getUserList();
        UU.setAge(11);
    }

    static class User {
        User userList;
        private String name;
        private int age;
        private BigDecimal decimal;
        Integer money ;
        public User() {
        }
        public User(String name) {
            this.name = name;
        }

        public BigDecimal getDecimal() {
            return decimal;
        }

        public void setDecimal(BigDecimal decimal) {
            this.decimal = decimal;
        }

        public Long getMoney1() {
            return money1;
        }

        public void setMoney1(Long money1) {
            this.money1 = money1;
        }

        Long money1 ;


        public Integer getMoney() {
            return money;
        }

        public void setMoney(Integer money) {
            this.money = money;
        }

        public User getUserList() {
            return userList;
        }

        public void setUserList(User userList) {
            this.userList = userList;
        }

        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public int getAge() {
            return age;
        }
        public void setAge(int age) {
            this.age = age;
        }
        @Override
        public String toString() {
            return "{name : " + name + ", age : " + age + "}";
        }
    }




}
